import { createRouter, createWebHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';
import { basicRoutes } from './menu';
const root = {
    name: '/',
    redirect:'/home',
}
const router_ = createRouter({
    history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH),
    routes: [
        ...basicRoutes,
        root
    ] as unknown as RouteRecordRaw[],
    strict: true,
    scrollBehavior: () => ({ left: 0, top: 0 }),
});
router_.beforeEach((form,to,next)=>{
    document.title = String(form.meta.title);
    next();
})
export const router = router_;